package com.lihq.scannertool.demo;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

import com.lihq.scannertool.DecodeCallBack;

public class MainActivity extends AppCompatActivity implements DecodeCallBack{
    private static final String TAG = "MainActivity";
    private TextView tv;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        tv = (TextView) findViewById(R.id.tv);
        tv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(MainActivity.this,Main2Activity.class);
                startActivity(intent);
            }
        });
    }


    @Override
    public void onDecodeComplete(String barcode) {
        Toast.makeText(this,barcode,Toast.LENGTH_SHORT).show();
        tv.setText(barcode);
    }
}
